package com.android.net.util

import com.camera.base.util.RunInMain
import kotlin.coroutines.Continuation
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext

abstract class HttpCallback<T> : Continuation<T> {
    override val context: CoroutineContext
        get() = EmptyCoroutineContext

    override fun resumeWith(result: Result<T>) {
        RunInMain.dispatch{
            this.onResult(result.getOrNull())
        }
    }

    abstract fun onResult(var1: T?): Array<String?>?
}